<?php

/**
 * @package Nina
 * @author John Main <john@thedaddy.org>, Andrew Rose <rose.andrew@gmail.com>
 */
abstract class Nina_Db_Driver_Statement
{
	protected $db;

	/**
	 * Set the SQL to prepare.
	 * @param string $sql SQL
	 */
	abstract public function setSql($sql);

	/**
	 * Get the prepared SQL.
	 * @return string
	 */
	abstract public function getSql();

	/**
	 * Bind variables to the statement.
	 * Variables are written :varname.
	 * @param Array $vars Variables
	 */
	abstract public function bind(Array $vars);

	/**
	 * Execute the statement and return a result.
	 * @return Nina_Db_Adaptor_Result
	 */
	abstract public function execute();

	/**
	 * Set the DB adapter
	 * @param Nina_Db_Driver $db
	 */
	public function setDb($db) {
		$this->db = $db;
	}

	/**
	 * Get the DB adapter
	 * @return Nina_Db_Driver
	 */
	public function getDb() {
		return $this->db;
	}
}
